package meta.api.web.operation.businessinfo;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonProperty;

import meta.common.util.StrUtil;

public class ValueInfo implements Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @JsonProperty
    private Long id;

    /**
     * 类型
     */
    @JsonProperty
    private String type;


    /**
     * Key
     */
    @JsonProperty
    private String key;

    /**
     * 值
     */
    @JsonProperty
    private Object value;

    public boolean checkRequiredField4Get() {
        if (StrUtil.isEmpty(type) || StrUtil.isEmpty(key)) {
            return false;
        }
        return true;
    }

    public boolean checkRequiredField4Save() {
        if (StrUtil.isEmpty(type) || StrUtil.isEmpty(key) || value == null) {
            return false;
        }
        return true;
    }

    public boolean checkRequiredField4Delete() {
        if (StrUtil.isEmpty(type) && StrUtil.isEmpty(key)) {
            return false;
        }
        return true;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }
}
